package online.shenme.day08_self;

import java.util.Random;

public class Randow {
    public static void main(String[] args) {
       int index=5;
        int[] arr = new int[index];
        Random randow = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = randow.nextInt(5) + 1;
            for (int j = 0; j < i; j++) {
                while (arr[i] == arr[j]) {
                    arr[i] = randow.nextInt(5) + 1;
                    j=0;
                }
            }
        }
        for (int j : arr) {
            System.out.print(j+"\t");
        }
        System.out.println();
    }
}


